home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / AppleTalk.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  26.2 KB  |  772 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleTalk.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT AppleTalk;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __APPLETALK__}
  27. {$SETC __APPLETALK__ := 1}
  28.  
  29. {$I+}
  30. {$SETC AppleTalkIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __OSUTILS__}
  40. {$I OSUtils.p}
  41. {$ENDC}
  42. {    MixedMode.p                                                    }
  43. {    Memory.p                                                    }
  44.  
  45. {$PUSH}
  46. {$ALIGN MAC68K}
  47. {$LibExport+}
  48.  
  49. CONST
  50. { Driver unit and reference numbers (ADSP is dynamic) }
  51.     mppUnitNum                    = 9;                            { MPP unit number }
  52.     atpUnitNum                    = 10;                            { ATP unit number }
  53.     xppUnitNum                    = 40;                            { XPP unit number }
  54.     mppRefNum                    = -10;                            { MPP reference number }
  55.     atpRefNum                    = -11;                            { ATP reference number }
  56.     xppRefNum                    = -41;                            { XPP reference number }
  57. { .MPP csCodes }
  58.     lookupReply                    = 242;                            { This command queued to ourself }
  59.     writeLAP                    = 243;                            { Write out LAP packet }
  60.     detachPH                    = 244;                            { Detach LAP protocol handler }
  61.     attachPH                    = 245;                            { Attach LAP protocol handler }
  62.     writeDDP                    = 246;                            { Write out DDP packet }
  63.     closeSkt                    = 247;                            { Close DDP socket }
  64.     openSkt                        = 248;                            { Open DDP socket }
  65.     loadNBP                        = 249;                            { Load NBP command-executing code }
  66.     lastResident                = 249;                            { Last resident command }
  67.     confirmName                    = 250;                            { Confirm name }
  68.     lookupName                    = 251;                            { Look up name on internet }
  69.     removeName                    = 252;                            { Remove name from Names Table }
  70.     registerName                = 253;                            { Register name in Names Table }
  71.     killNBP                        = 254;                            { Kill outstanding NBP request }
  72.  
  73.     unloadNBP                    = 255;                            { Unload NBP command code }
  74.     setSelfSend                    = 256;                            { MPP: Set to allow writes to self }
  75.     SetMyZone                    = 257;                            { Set my zone name }
  76.     GetATalkInfo                = 258;                            { get AppleTalk information }
  77.     ATalkClosePrep                = 259;                            { AppleTalk close query }
  78. { .ATP csCodes }
  79.     nSendRequest                = 248;                            { NSendRequest code }
  80.     relRspCB                    = 249;                            { Release RspCB }
  81.     closeATPSkt                    = 250;                            { Close ATP socket }
  82.     addResponse                    = 251;                            { Add response code | Require open skt }
  83.     sendResponse                = 252;                            { Send response code }
  84.     getRequest                    = 253;                            { Get request code }
  85.     openATPSkt                    = 254;                            { Open ATP socket }
  86.     sendRequest                    = 255;                            { Send request code }
  87.     relTCB                        = 256;                            { Release TCB }
  88.     killGetReq                    = 257;                            { Kill GetRequest }
  89.     killSendReq                    = 258;                            { Kill SendRequest }
  90.     killAllGetReq                = 259;                            { Kill all getRequests for a skt }
  91. { .XPP csCodes }
  92.     openSess                    = 255;                            { Open session }
  93.     closeSess                    = 254;                            { Close session }
  94.     userCommand                    = 253;                            { User command }
  95.  
  96.     userWrite                    = 252;                            { User write }
  97.     getStatus                    = 251;                            { Get status }
  98.     afpCall                        = 250;                            { AFP command (buffer has command code) }
  99.     getParms                    = 249;                            { Get parameters }
  100.     abortOS                        = 248;                            { Abort open session request }
  101.     closeAll                    = 247;                            { Close all open sessions }
  102.     xCall                        = 246;                            { .XPP extended calls }
  103. { Transition Queue transition types }
  104.     ATTransOpen                    = 0;                            {AppleTalk has opened}
  105.     ATTransClose                = 2;                            {AppleTalk is about to close}
  106.     ATTransClosePrep            = 3;                            {Is it OK to close AppleTalk ?}
  107.     ATTransCancelClose            = 4;                            {Cancel the ClosePrep transition}
  108.     afpByteRangeLock            = 1;                            {AFPCall command codes}
  109.     afpVolClose                    = 2;                            {AFPCall command codes}
  110.     afpDirClose                    = 3;                            {AFPCall command codes}
  111.     afpForkClose                = 4;                            {AFPCall command codes}
  112.     afpCopyFile                    = 5;                            {AFPCall command codes}
  113.     afpDirCreate                = 6;                            {AFPCall command codes}
  114.     afpFileCreate                = 7;                            {AFPCall command codes}
  115.     afpDelete                    = 8;                            {AFPCall command codes}
  116.     afpEnumerate                = 9;                            {AFPCall command codes}
  117.  
  118.     afpFlush                    = 10;                            {AFPCall command codes}
  119.     afpForkFlush                = 11;                            {AFPCall command codes}
  120.     afpGetDirParms                = 12;                            {AFPCall command codes}
  121.     afpGetFileParms                = 13;                            {AFPCall command codes}
  122.     afpGetForkParms                = 14;                            {AFPCall command codes}
  123.     afpGetSInfo                    = 15;                            {AFPCall command codes}
  124.     afpGetSParms                = 16;                            {AFPCall command codes}
  125.     afpGetVolParms                = 17;                            {AFPCall command codes}
  126.     afpLogin                    = 18;                            {AFPCall command codes}
  127.     afpContLogin                = 19;                            {AFPCall command codes}
  128.     afpLogout                    = 20;                            {AFPCall command codes}
  129.     afpMapID                    = 21;                            {AFPCall command codes}
  130.     afpMapName                    = 22;                            {AFPCall command codes}
  131.     afpMove                        = 23;                            {AFPCall command codes}
  132.     afpOpenVol                    = 24;                            {AFPCall command codes}
  133.     afpOpenDir                    = 25;                            {AFPCall command codes}
  134.     afpOpenFork                    = 26;                            {AFPCall command codes}
  135.     afpRead                        = 27;                            {AFPCall command codes}
  136.     afpRename                    = 28;                            {AFPCall command codes}
  137.     afpSetDirParms                = 29;                            {AFPCall command codes}
  138.  
  139.     afpSetFileParms                = 30;                            {AFPCall command codes}
  140.     afpSetForkParms                = 31;                            {AFPCall command codes}
  141.     afpSetVolParms                = 32;                            {AFPCall command codes}
  142.     afpWrite                    = 33;                            {AFPCall command codes}
  143.     afpGetFlDrParms                = 34;                            {AFPCall command codes}
  144.     afpSetFlDrParms                = 35;                            {AFPCall command codes}
  145.     afpDTOpen                    = 48;                            {AFPCall command codes}
  146.     afpDTClose                    = 49;                            {AFPCall command codes}
  147.     afpGetIcon                    = 51;                            {AFPCall command codes}
  148.     afpGtIcnInfo                = 52;                            {AFPCall command codes}
  149.     afpAddAPPL                    = 53;                            {AFPCall command codes}
  150.     afpRmvAPPL                    = 54;                            {AFPCall command codes}
  151.     afpGetAPPL                    = 55;                            {AFPCall command codes}
  152.     afpAddCmt                    = 56;                            {AFPCall command codes}
  153.     afpRmvCmt                    = 57;                            {AFPCall command codes}
  154.     afpGetCmt                    = 58;                            {AFPCall command codes}
  155.     afpAddIcon                    = 192;                            {Special code for ASP Write commands}
  156.     xppLoadedBit                = 5;                            { XPP bit in PortBUse }
  157.     scbMemSize                    = 192;                            { Size of memory for SCB }
  158.     xppFlagClr                    = 0;                            { Cs for AFPCommandBlock }
  159.  
  160.     xppFlagSet                    = 128;                            { StartEndFlag & NewLineFlag fields. }
  161.     lapSize                        = 20;
  162.     ddpSize                        = 26;
  163.     nbpSize                        = 26;
  164.     atpSize                        = 56;
  165.     atpXOvalue                    = 32;                            {ATP exactly-once bit }
  166.     atpEOMvalue                    = 16;                            {ATP End-Of-Message bit }
  167.     atpSTSvalue                    = 8;                            {ATP Send-Transmission-Status bit }
  168.     atpTIDValidvalue            = 2;                            {ATP trans. ID valid bit }
  169.     atpSendChkvalue                = 1;                            {ATP send checksum bit }
  170.     zipGetLocalZones            = 5;
  171.     zipGetZoneList                = 6;
  172.     zipGetMyZone                = 7;
  173.     LAPMgrPtr                    = $B18;                            {Entry point for LAP Manager}
  174.     LAPMgrCall                    = 2;                            {Offset to LAP routines}
  175.     LAddAEQ                        = 23;                            {LAPAddATQ routine selector}
  176.     LRmvAEQ                        = 24;                            {LAPRmvATQ routine selector}
  177.  
  178.     tLAPRead                    = 0;
  179.     tLAPWrite                    = 1;
  180.     tDDPRead                    = 2;
  181.     tDDPWrite                    = 3;
  182.     tNBPLookup                    = 4;
  183.     tNBPConfirm                    = 5;
  184.     tNBPRegister                = 6;
  185.     tATPSndRequest                = 7;
  186.     tATPGetRequest                = 8;
  187.     tATPSdRsp                    = 9;
  188.     tATPAddRsp                    = 10;
  189.     tATPRequest                    = 11;
  190.     tATPResponse                = 12;
  191.  
  192.     
  193. TYPE
  194.     ABCallType = SInt8;
  195.  
  196.  
  197. CONST
  198.     lapProto                    = 0;
  199.     ddpProto                    = 1;
  200.     nbpProto                    = 2;
  201.     atpProto                    = 3;
  202.  
  203.     
  204. TYPE
  205.     ABProtoType = UInt8;
  206.  
  207.     ABByte = Byte;
  208.  
  209.     LAPAdrBlock = PACKED RECORD
  210.         dstNodeID:                UInt8;
  211.         srcNodeID:                UInt8;
  212.         lapProtType:            ABByte;
  213.         filler:                    UInt8;                                    {    Filler for proper byte alignment}
  214.     END;
  215.     ATQEntryPtr = ^ATQEntry;
  216.  
  217.     ATalkTransitionEventProcPtr = ProcPtr;  { FUNCTION ATalkTransitionEvent(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr): LONGINT; }
  218.     ATalkTransitionEventUPP = UniversalProcPtr;
  219.  
  220.     ATalkTransitionEvent = ATalkTransitionEventUPP;
  221.  
  222.     ATQEntry = RECORD
  223.         qLink:                    ^ATQEntry;                                {next queue entry}
  224.         qType:                    INTEGER;                                {queue type}
  225.         CallAddr:                ATalkTransitionEventUPP;                {your routine descriptor}
  226.     END;
  227.     AddrBlock = RECORD
  228.         aNet:                    UInt16;
  229.         aNode:                    SInt8;
  230.         aSocket:                SInt8;
  231.     END;
  232. { Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  233. offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  234. In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  235. only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  236. be the same, which is OK since they are not used. }
  237.     EntityName = RECORD
  238.         objStr:                    Str32;
  239.         pad1:                    SInt8;                                    {Str32's aligned on even word boundries.}
  240.         typeStr:                Str32;
  241.         pad2:                    SInt8;
  242.         zoneStr:                Str32;
  243.         pad3:                    SInt8;
  244.     END;
  245.     EntityPtr = ^EntityName;
  246.  
  247.     RetransType = PACKED RECORD
  248.         retransInterval:        UInt8;
  249.         retransCount:            UInt8;
  250.     END;
  251.     BDSElement = RECORD
  252.         buffSize:                INTEGER;
  253.         buffPtr:                Ptr;
  254.         dataSize:                INTEGER;
  255.         userBytes:                LONGINT;
  256.     END;
  257.     BDSType = ARRAY [0..7] OF BDSElement;
  258.  
  259.     BDSPtr = ^BDSElement;
  260.  
  261.     BitMapType = PACKED ARRAY [0..7] OF BOOLEAN;
  262.  
  263.     ATLAPRec = RECORD
  264.         abOpcode:                ABCallType;
  265.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  266.         abResult:                INTEGER;
  267.         abUserReference:        LONGINT;
  268.         lapAddress:                LAPAdrBlock;
  269.         lapReqCount:            INTEGER;
  270.         lapActCount:            INTEGER;
  271.         lapDataPtr:                Ptr;
  272.     END;
  273.     ATLAPRecPtr = ^ATLAPRec;
  274.     ATLAPRecHandle = ^ATLAPRecPtr;
  275.  
  276.     ATDDPRec = RECORD
  277.         abOpcode:                ABCallType;
  278.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  279.         abResult:                INTEGER;
  280.         abUserReference:        LONGINT;
  281.         ddpType:                INTEGER;
  282.         ddpSocket:                INTEGER;
  283.         ddpAddress:                AddrBlock;
  284.         ddpReqCount:            INTEGER;
  285.         ddpActCount:            INTEGER;
  286.         ddpDataPtr:                Ptr;
  287.         ddpNodeID:                INTEGER;
  288.     END;
  289.     ATDDPRecPtr = ^ATDDPRec;
  290.     ATDDPRecHandle = ^ATDDPRecPtr;
  291.  
  292.     ATNBPRec = RECORD
  293.         abOpcode:                ABCallType;
  294.         filler:                    SInt8;                                    {    Filler for proper byte alignment}
  295.         abResult:                INTEGER;
  296.         abUserReference:        LONGINT;
  297.         nbpEntityPtr:            EntityPtr;
  298.         nbpBufPtr:                Ptr;
  299.         nbpBufSize:                INTEGER;
  300.         nbpDataField:            INTEGER;
  301.         nbpAddress:                AddrBlock;
  302.         nbpRetransmitInfo:        RetransType;
  303.     END;
  304.     ATNBPRecPtr = ^ATNBPRec;
  305.     ATNBPRecHandle = ^ATNBPRecPtr;
  306.  
  307.     ATATPRec = RECORD
  308.         abOpcode:                ABCallType;
  309.         filler1:                SInt8;                                    {    Filler for proper byte alignment}
  310.         abResult:                INTEGER;
  311.         abUserReference:        LONGINT;
  312.         atpSocket:                INTEGER;
  313.         atpAddress:                AddrBlock;
  314.         atpReqCount:            INTEGER;
  315.         atpDataPtr:                Ptr;
  316.         atpRspBDSPtr:            BDSPtr;
  317.         atpBitMap:                BitMapType;
  318.         filler2:                SInt8;                                    {    Filler for proper byte alignment}
  319.         atpTransID:                INTEGER;
  320.         atpActCount:            INTEGER;
  321.         atpUserData:            LONGINT;
  322.         atpXO:                    BOOLEAN;
  323.         atpEOM:                    BOOLEAN;
  324.         atpTimeOut:                INTEGER;
  325.         atpRetries:                INTEGER;
  326.         atpNumBufs:                INTEGER;
  327.         atpNumRsp:                INTEGER;
  328.         atpBDSSize:                INTEGER;
  329.         atpRspUData:            LONGINT;
  330.         atpRspBuf:                Ptr;
  331.         atpRspSize:                INTEGER;
  332.     END;
  333.     ATATPRecPtr = ^ATATPRec;
  334.     ATATPRecHandle = ^ATATPRecPtr;
  335.  
  336.     AFPCommandBlock = PACKED RECORD
  337.         cmdByte:                UInt8;
  338.         startEndFlag:            UInt8;
  339.         forkRefNum:                INTEGER;
  340.         rwOffset:                LONGINT;
  341.         reqCount:                LONGINT;
  342.         newLineFlag:            UInt8;
  343.         newLineChar:            CHAR;
  344.     END;
  345.     MPPPBPtr = ^MPPParamBlock;
  346.  
  347.     ATPPBPtr = ^ATPParamBlock;
  348.  
  349.     XPPParmBlkPtr = ^XPPParamBlock;
  350.  
  351.     {
  352.         MPPCompletionProcPtr uses register based parameters on the 68k and cannot
  353.         be written in or called from a high-level language without the help of
  354.         mixed mode or assembly glue.
  355.  
  356.         In:
  357.          => thePBptr        A0.L
  358.     }
  359.     MPPCompletionProcPtr = ProcPtr;  { PROCEDURE MPPCompletion(thePBptr: MPPPBPtr); }
  360.     {
  361.         ATPCompletionProcPtr uses register based parameters on the 68k and cannot
  362.         be written in or called from a high-level language without the help of
  363.         mixed mode or assembly glue.
  364.  
  365.         In:
  366.          => thePBptr        A0.L
  367.     }
  368.     ATPCompletionProcPtr = ProcPtr;  { PROCEDURE ATPCompletion(thePBptr: ATPPBPtr); }
  369.     {
  370.         XPPCompletionProcPtr uses register based parameters on the 68k and cannot
  371.         be written in or called from a high-level language without the help of
  372.         mixed mode or assembly glue.
  373.  
  374.         In:
  375.          => thePBptr        A0.L
  376.     }
  377.     XPPCompletionProcPtr = ProcPtr;  { PROCEDURE XPPCompletion(thePBptr: XPPParmBlkPtr); }
  378.     {
  379.         AttnRoutineProcPtr uses register based parameters on the 68k and cannot
  380.         be written in or called from a high-level language without the help of
  381.         mixed mode or assembly glue.
  382.  
  383.         In:
  384.          => sessRefnum      D0.W
  385.          => attnBytes       D1.W
  386.     }
  387.     AttnRoutineProcPtr = ProcPtr;  { PROCEDURE AttnRoutine(sessRefnum: INTEGER; attnBytes: INTEGER); }
  388.     MPPCompletionUPP = UniversalProcPtr;
  389.     ATPCompletionUPP = UniversalProcPtr;
  390.     XPPCompletionUPP = UniversalProcPtr;
  391.     AttnRoutineUPP = UniversalProcPtr;
  392.  
  393.     WDSElement = RECORD
  394.         entryLength:            INTEGER;
  395.         entryPtr:                Ptr;
  396.     END;
  397.     NTElement = RECORD
  398.         nteAddress:                AddrBlock;                                {network address of entity}
  399.         filler:                    SInt8;
  400.         entityData:                PACKED ARRAY [0..98] OF SInt8;            {Object, Type & Zone}
  401.     END;
  402.     NamesTableEntry = RECORD
  403.         qNext:                    Ptr;                                    {ptr to next NTE}
  404.         nt:                        NTElement;
  405.     END;
  406.     MPPProtocolHandlerProcPtr = ProcPtr;  { FUNCTION MPPProtocolHandler(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  407.     DDPSocketListenerProcPtr = ProcPtr;  { FUNCTION DDPSocketListener(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  408.     MPPProtocolHandlerUPP = UniversalProcPtr;
  409.     DDPSocketListenerUPP = UniversalProcPtr;
  410.  
  411.     MPPParamBlock = RECORD
  412.         qLink:                    ^QElem;
  413.         qType:                    INTEGER;
  414.         ioTrap:                    INTEGER;
  415.         ioCmdAddr:                Ptr;
  416.         ioCompletion:            ATPCompletionUPP;
  417.         ioResult:                OSErr;
  418.         userData:                LONGINT;
  419.         reqTID:                    INTEGER;
  420.         ioRefNum:                INTEGER;
  421.         csCode:                    INTEGER;
  422.         CASE INTEGER OF
  423.         0: (
  424.             filler0:                    INTEGER;
  425.             wdsPointer:                    Ptr;
  426.            );
  427.         1: (
  428.             protType:                    SInt8;
  429.             filler:                        SInt8;
  430.             handler:                    MPPProtocolHandlerUPP;
  431.            );
  432.         2: (
  433.             socket:                        SInt8;
  434.             checksumFlag:                SInt8;
  435.             listener:                    DDPSocketListenerUPP;
  436.            );
  437.         3: (
  438.             interval:                    SInt8;                                {retry interval }
  439.             count:                        SInt8;                                {retry count }
  440.             nbpPtrs:                    Ptr;
  441.             CASE INTEGER OF
  442.             0: (
  443.                 verifyFlag:                        SInt8;
  444.                 filler3:                        SInt8;
  445.                );
  446.             1: (
  447.                 retBuffPtr:                        Ptr;
  448.                 retBuffSize:                    INTEGER;
  449.                 maxToGet:                        INTEGER;
  450.                 numGotten:                        INTEGER;
  451.                );
  452.             2: (
  453.                 confirmAddr:                    AddrBlock;
  454.                 newSocket:                        SInt8;
  455.                 filler4:                        SInt8;
  456.                );
  457.            );
  458.         4: (
  459.             newSelfFlag:                SInt8;                                {self-send toggle flag }
  460.             oldSelfFlag:                SInt8;                                {previous self-send state }
  461.            );
  462.         5: (
  463.             nKillQEl:                    Ptr;                                {ptr to i/o queue element to cancel }
  464.            );
  465.         6: (
  466.             version:                    INTEGER;
  467.             varsPtr:                    Ptr;
  468.             DCEPtr:                        Ptr;
  469.             portID:                        INTEGER;
  470.             configuration:                LONGINT;
  471.             selfSend:                    INTEGER;
  472.             netLo:                        INTEGER;
  473.             netHi:                        INTEGER;
  474.             ourAdd:                        LONGINT;
  475.             routerAddr:                    LONGINT;
  476.             numOfPHs:                    INTEGER;
  477.             numOfSkts:                    INTEGER;
  478.             numNBPEs:                    INTEGER;
  479.             nTQueue:                    Ptr;
  480.             LAlength:                    INTEGER;
  481.             linkAddr:                    Ptr;
  482.             zoneName:                    Ptr;
  483.            );
  484.         7: (
  485.             appName:                    Ptr;                                {pointer to application name in buffer}
  486.            );
  487.     END;
  488.     XPPParamBlock = RECORD
  489.         qLink:                    ^QElem;
  490.         qType:                    INTEGER;
  491.         ioTrap:                    INTEGER;
  492.         ioCmdAddr:                Ptr;
  493.         ioCompletion:            XPPCompletionUPP;
  494.         ioResult:                OSErr;
  495.         cmdResult:                LONGINT;
  496.         ioVRefNum:                INTEGER;
  497.         ioRefNum:                INTEGER;
  498.         csCode:                    INTEGER;
  499.         CASE INTEGER OF
  500.         0: (
  501.             abortSCBPtr:                Ptr;                                { SCB pointer for AbortOS}
  502.            );
  503.         1: (
  504.             aspMaxCmdSize:                INTEGER;
  505.             aspQuantumSize:                INTEGER;
  506.             numSesss:                    INTEGER;
  507.            );
  508.         2: (
  509.             sessRefnum:                    INTEGER;
  510.             aspTimeout:                    SInt8;
  511.             aspRetry:                    SInt8;
  512.             CASE INTEGER OF
  513.             0: (
  514.                 serverAddr:                        AddrBlock;
  515.                 scbPointer:                        Ptr;
  516.                 attnRoutine:                    AttnRoutineUPP;
  517.                );
  518.             1: (
  519.                 cbSize:                            INTEGER;
  520.                 cbPtr:                            Ptr;
  521.                 rbSize:                            INTEGER;
  522.                 rbPtr:                            Ptr;
  523.                 CASE INTEGER OF
  524.                 0: (
  525.                     afpAddrBlock:                        AddrBlock;
  526.                     afpSCBPtr:                            Ptr;
  527.                     afpAttnRoutine:                        Ptr;
  528.                    );
  529.                 1: (
  530.                     wdSize:                                INTEGER;
  531.                     wdPtr:                                Ptr;
  532.                     ccbStart:                            ARRAY [0..295] OF SInt8;
  533.                    );
  534.                );
  535.            );
  536.         3: (
  537.             xppSubCode:                    INTEGER;
  538.             xppTimeout:                    SInt8;
  539.             xppRetry:                    SInt8;
  540.             filler1:                    INTEGER;
  541.             zipBuffPtr:                    Ptr;
  542.             zipNumZones:                INTEGER;
  543.             zipLastFlag:                SInt8;
  544.             filler2:                    SInt8;
  545.             zipInfoField:                PACKED ARRAY [0..69] OF SInt8;
  546.            );
  547.     END;
  548.     ATPParamBlock = RECORD
  549.         qLink:                    ^QElem;
  550.         qType:                    INTEGER;
  551.         ioTrap:                    INTEGER;
  552.         ioCmdAddr:                Ptr;
  553.         ioCompletion:            ATPCompletionUPP;
  554.         ioResult:                OSErr;
  555.         userData:                LONGINT;
  556.         reqTID:                    INTEGER;
  557.         ioRefNum:                INTEGER;
  558.         csCode:                    INTEGER;
  559.         atpSocket:                SInt8;
  560.         atpFlags:                SInt8;
  561.         addrBlock:                AddrBlock;
  562.         reqLength:                INTEGER;
  563.         reqPointer:                Ptr;
  564.         bdsPointer:                Ptr;
  565.         CASE INTEGER OF
  566.         0: (
  567.             numOfBuffs:                    SInt8;
  568.             timeOutVal:                    SInt8;
  569.             numOfResps:                    SInt8;
  570.             retryCount:                    SInt8;
  571.             intBuff:                    INTEGER;
  572.             TRelTime:                    SInt8;
  573.            );
  574.         1: (
  575.             filler:                        SInt8;
  576.             bdsSize:                    SInt8;
  577.             transID:                    INTEGER;
  578.            );
  579.         2: (
  580.             bitMap:                        SInt8;
  581.             filler2:                    SInt8;
  582.            );
  583.         3: (
  584.             rspNum:                        SInt8;
  585.             filler3:                    SInt8;
  586.            );
  587.         4: (
  588.             aKillQEl:                    Ptr;
  589.            );
  590.     END;
  591.  
  592. CONST
  593.     uppATalkTransitionEventProcInfo = $00000FF1; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 4 byte result; }
  594.     uppMPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  595.     uppATPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  596.     uppXPPCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  597.     uppAttnRoutineProcInfo = $00061002; { Register PROCEDURE (2 bytes in D0, 2 bytes in D1); }
  598.     uppMPPProtocolHandlerProcInfo = $0000007F; { SPECIAL_CASE_PROCINFO( kSpecialCaseProtocolHandler ) }
  599.     uppDDPSocketListenerProcInfo = $0000008F; { SPECIAL_CASE_PROCINFO( kSpecialCaseSocketListener ) }
  600.  
  601. FUNCTION NewATalkTransitionEventProc(userRoutine: ATalkTransitionEventProcPtr): ATalkTransitionEventUPP;
  602.     {$IFC NOT GENERATINGCFM }
  603.     INLINE $2E9F;
  604.     {$ENDC}
  605.  
  606. FUNCTION NewMPPCompletionProc(userRoutine: MPPCompletionProcPtr): MPPCompletionUPP;
  607.     {$IFC NOT GENERATINGCFM }
  608.     INLINE $2E9F;
  609.     {$ENDC}
  610.  
  611. FUNCTION NewATPCompletionProc(userRoutine: ATPCompletionProcPtr): ATPCompletionUPP;
  612.     {$IFC NOT GENERATINGCFM }
  613.     INLINE $2E9F;
  614.     {$ENDC}
  615.  
  616. FUNCTION NewXPPCompletionProc(userRoutine: XPPCompletionProcPtr): XPPCompletionUPP;
  617.     {$IFC NOT GENERATINGCFM }
  618.     INLINE $2E9F;
  619.     {$ENDC}
  620.  
  621. FUNCTION NewAttnRoutineProc(userRoutine: AttnRoutineProcPtr): AttnRoutineUPP;
  622.     {$IFC NOT GENERATINGCFM }
  623.     INLINE $2E9F;
  624.     {$ENDC}
  625.  
  626. FUNCTION NewMPPProtocolHandlerProc(userRoutine: MPPProtocolHandlerProcPtr): MPPProtocolHandlerUPP;
  627.     {$IFC NOT GENERATINGCFM }
  628.     INLINE $2E9F;
  629.     {$ENDC}
  630.  
  631. FUNCTION NewDDPSocketListenerProc(userRoutine: DDPSocketListenerProcPtr): DDPSocketListenerUPP;
  632.     {$IFC NOT GENERATINGCFM }
  633.     INLINE $2E9F;
  634.     {$ENDC}
  635.  
  636. FUNCTION CallATalkTransitionEventProc(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr; userRoutine: ATalkTransitionEventUPP): LONGINT;
  637.     {$IFC NOT GENERATINGCFM}
  638.     INLINE $205F, $4E90;
  639.     {$ENDC}
  640.  
  641. PROCEDURE CallMPPCompletionProc(thePBptr: MPPPBPtr; userRoutine: MPPCompletionUPP);
  642.     {$IFC NOT GENERATINGCFM}
  643.     {To be implemented:  Glue to move parameters into registers.}
  644.     {$ENDC}
  645.  
  646. PROCEDURE CallATPCompletionProc(thePBptr: ATPPBPtr; userRoutine: ATPCompletionUPP);
  647.     {$IFC NOT GENERATINGCFM}
  648.     {To be implemented:  Glue to move parameters into registers.}
  649.     {$ENDC}
  650.  
  651. PROCEDURE CallXPPCompletionProc(thePBptr: XPPParmBlkPtr; userRoutine: XPPCompletionUPP);
  652.     {$IFC NOT GENERATINGCFM}
  653.     {To be implemented:  Glue to move parameters into registers.}
  654.     {$ENDC}
  655.  
  656. PROCEDURE CallAttnRoutineProc(sessRefnum: INTEGER; attnBytes: INTEGER; userRoutine: AttnRoutineUPP);
  657.     {$IFC NOT GENERATINGCFM}
  658.     {To be implemented:  Glue to move parameters into registers.}
  659.     {$ENDC}
  660.  
  661. FUNCTION CallMPPProtocolHandlerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER; userRoutine: MPPProtocolHandlerUPP): BOOLEAN;
  662.     {$IFC NOT GENERATINGCFM}
  663.     {To be implemented:  Glue to move parameters according to special case conventions.}
  664.     {$ENDC}
  665.  
  666. FUNCTION CallDDPSocketListenerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER; userRoutine: DDPSocketListenerUPP): BOOLEAN;
  667.     {$IFC NOT GENERATINGCFM}
  668.     {To be implemented:  Glue to move parameters according to special case conventions.}
  669.     {$ENDC}
  670.  
  671. FUNCTION OpenXPP(VAR xppRefnum: INTEGER): OSErr;
  672. FUNCTION ASPOpenSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  673. FUNCTION ASPCloseSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  674. FUNCTION ASPAbortOS(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  675. FUNCTION ASPGetParms(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  676. FUNCTION ASPCloseAll(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  677. FUNCTION ASPUserWrite(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  678. FUNCTION ASPUserCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  679. FUNCTION ASPGetStatus(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  680. FUNCTION AFPCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  681. FUNCTION GetLocalZones(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  682. FUNCTION GetZoneList(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  683. FUNCTION GetMyZone(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  684. FUNCTION PAttachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  685. FUNCTION PDetachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  686. FUNCTION PWriteLAP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  687. FUNCTION POpenSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  688. FUNCTION PCloseSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  689. FUNCTION PWriteDDP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  690. FUNCTION PRegisterName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  691. FUNCTION PLookupName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  692. FUNCTION PConfirmName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  693. FUNCTION PRemoveName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  694. FUNCTION PSetSelfSend(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  695. FUNCTION PKillNBP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  696. FUNCTION PGetAppleTalkInfo(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  697. FUNCTION PATalkClosePrep(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  698. FUNCTION POpenATPSkt(thePBptr: ATPPBPtr; async: BOOLEAN): OSErr;
  699. FUNCTION PCloseATPSkt(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  700. FUNCTION PSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  701. FUNCTION PGetRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  702. FUNCTION PSendResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  703. FUNCTION PAddResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  704. FUNCTION PRelTCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  705. FUNCTION PRelRspCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  706. FUNCTION PNSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  707. FUNCTION PKillSendReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  708. FUNCTION PKillGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  709. FUNCTION ATPKillAllGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  710. PROCEDURE BuildLAPwds(wdsPtr: Ptr; dataPtr: Ptr; destHost: INTEGER; prototype: INTEGER; frameLen: INTEGER);
  711. PROCEDURE BuildDDPwds(wdsPtr: Ptr; headerPtr: Ptr; dataPtr: Ptr; netAddr: AddrBlock; ddpType: INTEGER; dataLen: INTEGER);
  712. PROCEDURE NBPSetEntity(buffer: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param);
  713. PROCEDURE NBPSetNTE(ntePtr: Ptr; nbpObject: ConstStr32Param; nbpType: ConstStr32Param; nbpZone: ConstStr32Param; socket: INTEGER);
  714. FUNCTION GetBridgeAddress: INTEGER;
  715. FUNCTION BuildBDS(buffPtr: Ptr; bdsPtr: Ptr; buffSize: INTEGER): INTEGER;
  716. FUNCTION MPPOpen: OSErr;
  717. FUNCTION LAPAddATQ(theATQEntry: ATQEntryPtr): OSErr;
  718. FUNCTION LAPRmvATQ(theATQEntry: ATQEntryPtr): OSErr;
  719. FUNCTION ATPLoad: OSErr;
  720. FUNCTION ATPUnload: OSErr;
  721. FUNCTION NBPExtract(theBuffer: Ptr; numInBuf: INTEGER; whichOne: INTEGER; VAR abEntity: EntityName; VAR address: AddrBlock): OSErr;
  722. FUNCTION GetNodeAddress(VAR myNode: INTEGER; VAR myNet: INTEGER): OSErr;
  723. FUNCTION IsMPPOpen: BOOLEAN;
  724. FUNCTION IsATPOpen: BOOLEAN;
  725. PROCEDURE ATEvent(event: LONGINT; infoPtr: Ptr);
  726. FUNCTION ATPreFlightEvent(event: LONGINT; cancel: LONGINT; infoPtr: Ptr): OSErr;
  727. {
  728.     The following routines are obsolete and will not be supported on
  729.     PowerPC. Equivalent functionality is provided by the routines
  730.     above.
  731. }
  732. {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  733. FUNCTION MPPClose: OSErr;
  734. FUNCTION LAPOpenProtocol(theLAPType: ByteParameter; protoPtr: Ptr): OSErr;
  735. FUNCTION LAPCloseProtocol(theLAPType: ByteParameter): OSErr;
  736. FUNCTION LAPWrite(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  737. FUNCTION LAPRead(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  738. FUNCTION LAPRdCancel(abRecord: ATLAPRecHandle): OSErr;
  739. FUNCTION DDPOpenSocket(VAR theSocket: INTEGER; sktListener: Ptr): OSErr;
  740. FUNCTION DDPCloseSocket(theSocket: INTEGER): OSErr;
  741. FUNCTION DDPRead(abRecord: ATDDPRecHandle; retCksumErrs: BOOLEAN; async: BOOLEAN): OSErr;
  742. FUNCTION DDPWrite(abRecord: ATDDPRecHandle; doChecksum: BOOLEAN; async: BOOLEAN): OSErr;
  743. FUNCTION DDPRdCancel(abRecord: ATDDPRecHandle): OSErr;
  744. FUNCTION ATPOpenSocket(addrRcvd: AddrBlock; VAR atpSocket: INTEGER): OSErr;
  745. FUNCTION ATPCloseSocket(atpSocket: INTEGER): OSErr;
  746. FUNCTION ATPSndRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  747. FUNCTION ATPRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  748. FUNCTION ATPReqCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  749. FUNCTION ATPGetRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  750. FUNCTION ATPSndRsp(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  751. FUNCTION ATPAddRsp(abRecord: ATATPRecHandle): OSErr;
  752. FUNCTION ATPResponse(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  753. FUNCTION ATPRspCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  754. FUNCTION NBPRegister(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  755. FUNCTION NBPLookup(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  756. FUNCTION NBPConfirm(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  757. FUNCTION NBPRemove(abEntity: EntityPtr): OSErr;
  758. FUNCTION NBPLoad: OSErr;
  759. FUNCTION NBPUnload: OSErr;
  760. {$ENDC}
  761.  
  762. {$ALIGN RESET}
  763. {$POP}
  764.  
  765. {$SETC UsingIncludes := AppleTalkIncludes}
  766.  
  767. {$ENDC} {__APPLETALK__}
  768.  
  769. {$IFC NOT UsingIncludes}
  770.  END.
  771. {$ENDC}
  772.